-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring #39110
Conversation
This is getting awkward, I was trying to do this just today. Hopefully they're the same idea. |
I prefer |
Ah, you changed the parser, more elegant than my lowering hack, heh. I'm not super sure about the changes to |
I actually thought about renaming it to something, but decided to avoid extra churn. |
Renamed |
@bors r+ |
📌 Commit 66ef5f2 has been approved by |
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring `ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them. The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality. The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided. The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`. This is the first part of #39085 (comment) and #39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later. r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
ObjectSum
andPolyTraitRef
are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.The first commit replaces
Path
withTy
in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.The third commit uses
Vec
instead ofP<[T]>
in AST. AST is not immutable like HIR andVec
s are more convenient for it, unnecessary conversions are also avoided.The last commit renames
parse_ty_sum
(which is used for parsing types in general) intoparse_ty
, and renamesparse_ty
(which is used restricted contexts where+
is not permitted due to operator priorities or other reasons) intoparse_ty_no_plus
.This is the first part of #39085 (comment) and #39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.
r? @eddyb